<style>
    #febs-device xm-select {
        min-height: 30px;
        line-height: 30px;
    }

</style>

<div class="layui-fluid layui-anim febs-anim" id="febs-device" lay-title="设备列表">
    <div class="layui-row layui-col-space8 febs-container">
        <div class="layui-col-md12 layui-col-sm12 layui-col-xs12">
            <div class="layui-card" style="margin: 0 auto;">
                <div class="layui-card-header">设备列表</div>
                <div class="layui-card-body user-profile-card">

<!--                    <form class="layui-form" action="" lay-filter="product-type-add">-->
<!--                        <div class="layui-row">-->
<!--                            <div class="layui-col-md10">-->
<!--                                <div class="layui-form-item">-->
<!--                                    <div class="layui-inline">-->
<!--                                        <label class="layui-form-label">商品名称：</label>-->
<!--                                        <div class="layui-input-inline">-->
<!--                                            <input type="text" name="productType" id="productType" class="layui-input">-->
<!--                                        </div>-->
<!--                                    </div>-->
<!--                                    <button class="layui-btn layui-btn-normal layui-btn-radius" lay-submit-->
<!--                                            lay-filter="product-type-submit" id="submit">-->
<!--                                        <i style="display: none; margin-left: 30px"-->
<!--                                           class="layui-icon layui-icon-loading layui-icon layui-anim layui-anim-rotate layui-anim-loop"></i>-->
<!--                                        添加商品-->
<!--                                    </button>-->
<!--                                </div>-->
<!--                            </div>-->
<!--                        </div>-->
<!--                    </form>-->

                    <table lay-filter="deviceTable" lay-data="{id: 'deviceTable'}"></table>

                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/html" id="user-option">
        <a lay-event="detail">
            <i class="layui-icon febs-edit-area febs-green">&#xe7a5;</i></a>
<!--        <a lay-event="edit"><i-->
<!--                class="layui-icon febs-edit-area febs-blue">&#xe7a4;</i></a>-->
<!--    <a lay-event="del"><i class="layui-icon febs-edit-area febs-red">&#xe7f9;</i></a>-->
</script>

<script data-th-inline="none" type="text/javascript">
    layui.use(['upload', 'jquery', 'febs', 'form', 'table'], function () {
        let $ = layui.jquery,
            febs = layui.febs,
            table = layui.table,
            form = layui.form,
            $view = $('#febs-device'),
            tableIns

        form.render();
        initDeviceTable();

        function initDeviceTable() {
            tableIns = febs.table.init({
                elem: $view.find('table'),
                id: 'deviceTable',
                url: ctx + 'web/get/devicetlist',
                method: 'post',
                page: false,
                totalRow: true,
                parseData: function (res) { //res 即为原始返回的数据
                    return {
                        "code": 0, //解析接口状态
                        "msg": "", //解析提示文本
                        data: res.data //解析数据列表
                    };
                },
                cols: [[
                    {field: 'id', title: 'id'},
                    {field: 'device_no', title: '设备号'},
                    {field: 'device_mac', title: '设备MAC地址'},
                    {field: 'device_ip', title: '设备IP地址'},
                    {field: 'register_state', title: '绑定的状态'},
                    {field: 'register_bed', title: '绑定床位号'},
                    {title: '操作', toolbar: '#user-option', width: 120}
                ]]
            });
        }

    })


</script>